package tests;

import org.junit.Assert;
import org.junit.Test;

import controller.Outils;

public class TestOutils {

	
	@Test
	
	public void testCheckIp(){
		String ipValide="192.168.1.15";
		String ipNonValide="254.895.152.15";
		String ipNonValide2="254.895.152";
		
		System.out.println(Outils.checkIp(ipValide));
		System.out.println(Outils.checkIp(ipNonValide));
		System.out.println(Outils.checkIp(ipNonValide2));
		
		Assert.assertTrue(Outils.checkIp(ipValide));
		Assert.assertFalse(Outils.checkIp(ipNonValide));
		Assert.assertFalse(Outils.checkIp(ipNonValide2));
	}
	
	@Test
	public void testCheckPort(){
		int portValide = 1256;
		int portNonValide = 89523;
		int portNonValide2 = -1254;
		
		Assert.assertTrue(Outils.checkPort(portValide));
		Assert.assertFalse(Outils.checkPort(portNonValide));
		Assert.assertFalse(Outils.checkPort(portNonValide2));
	}
	
}
